<template>
  <div id="app">
    <van-skeleton title avatar :row="5" v-if="isShow" />
    <router-view v-else v-slot="{ Component }">
      <keep-alive>
        <component :is="Component" />
      </keep-alive>
    </router-view>
  </div>
</template>

<script setup>
import { ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";

const router = useRouter();
const route = useRoute();

const isShow=ref(true)

watch(()=>route.name, () => {
  // 在嵌套的属性变更时触发
  // 注意：`newValue` 此处和 `oldValue` 是相等的
  // 因为它们是同一个对象！
  isShow.value=false;
},3000)

</script>

<style lang="scss" scoped></style>
